package com.ww.yaodao.controller;

import com.ww.yaodao.model.vo.sale.SaleRespVO;
import com.ww.yaodao.model.vo.sale.SaleVO;
import com.ww.yaodao.service.SaleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author wanziyan
 * @Date 2023-04-13:57
 */

@RestController
@RequestMapping("/sale")
@Api(tags = {"销售模块"})
@Validated
@Slf4j
@RequiredArgsConstructor
public class SaleController {
    private final SaleService saleService;

    @PostMapping("/querySale")
    @ApiOperation("查询所有销售信息")
    public SaleRespVO getAllSaleList(@RequestBody SaleVO saleVO){
        log.info("进入查询销售信息页面....");
        return saleService.getAllSaleList(saleVO);
    }

    @PostMapping("/updateSale")
    @ApiOperation("更新销售")
    public SaleRespVO updateSaleList(@RequestBody SaleVO saleVO){
        log.info("进入查询销售信息页面....");
        return saleService.updateSaleList(saleVO);
    }
}
